package com.raowb.common.config.asyn;

import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

import com.raowb.common.util.JsonUtil;

public class AsyncExceptionHandler implements AsyncUncaughtExceptionHandler {
	protected Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	public void handleUncaughtException(Throwable ex, Method method, Object... params) {
		logger.error("Async method: {} has uncaught exception,params:{}", method.getName(),
				JsonUtil.toJsonString(params));
		logger.error("Exception :"+ex.getMessage());

	}
}
